#include <stdio.h>
#include<iostream>

#ifdef _WIN64
#include<Windows.h>
#endif

extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}

#include <QApplication>
#include <QMutex>
#include <QSettings>
#include <QTextCodec>

#include "Logging.hxx"

#include "MainWindow.hxx"
#include "VideoView.hxx"

#include "VideoThread.hxx"
#include "Sequence.hxx"

//QSettings* __globalSettings;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

	QCoreApplication::addLibraryPath("./plugins");

    // Initialize ffmpeg
    av_register_all();
    avcodec_register_all();
    avformat_network_init();

    log_initialize();

    atexit(log_shutdown);

    MainWindow v;
    v.showMaximized();

    int rst = a.exec();

    //log_shutdown();
    return rst;
}
